//这个是旧版的项目中也有用到，不可删除
/**限制非中文*/
export function codeReg(data) {
  let temp = ""
  for (var i = 0; i < data.length; i++) {
    if (data.charCodeAt(i) > 0 && data.charCodeAt(i) < 255) {
      temp += data.charAt(i)
    }
  }
  return temp
}
/**身份证验证*/
export function cardReg(data) {
  let reg = /^(([1][1-5])|([2][1-3])|([3][1-7])|([4][1-6])|([5][0-4])|([6][1-5])|([7][1])|([8][1-2]))\d{4}(([1][9]\d{2})|([2]\d{3}))(([0][1-9])|([1][0-2]))(([0][1-9])|([1-2][0-9])|([3][0-1]))\d{3}[0-9xX]$/
  let re = new RegExp(reg);
  return re.test(data)
}
/**手机号验证*/
export function phoneReg(data) {
  let reg = /^1[3456789]\d{9}$/;
  let re = new RegExp(reg);
  return re.test(data)
}
/**验证两位数*/
export function sortReg(data) {
  let reg = /^[+]{0,1}(\d+)$/;
  let re = new RegExp(reg);
  return re.test(data)
}
/**所有车牌号验证*/
export function carReg(data) {
  let reg = /(^[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领A-Z]{1}[A-Z]{1}(([0-9]{5}[DF])|([DF]([A-HJ-NP-Z0-9])[0-9]{4})))|([京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领A-Z]{1}[A-Z]{1}[A-HJ-NP-Z0-9]{4}[A-HJ-NP-Z0-9挂学警港澳]{1}$)/;
  let re = new RegExp(reg);
  return re.test(data)
}